package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: xiaotutu
 * Date: 2023-11-10
 * Time: 8:53
 */

class Shape {
    public void draw() {
        System.out.println("画图形!");
    }
}

class Cycle extends Shape {
    @Override
    public void draw() {
        System.out.println("🟢");
    }
}

class Rect extends Shape {
    @Override
    public void draw() {
        System.out.println("🖼️");
    }
}


public class Test {

    public static void drawMap(Shape shape) {
        shape.draw();
    }

    public static void main(String[] args) {
        drawMap(new Cycle());
        drawMap(new Rect());
    }
}
